-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 头像裁剪组件 #2570
feat: 头像裁剪组件 #2570
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## v4 #2570 +/- ##
==========================================
- Coverage 84.99% 84.92% -0.08%
==========================================
Files 151 152 +1
Lines 20720 21172 +452
Branches 2323 2377 +54
==========================================
+ Hits 17611 17980 +369
- Misses 3104 3187 +83
Partials 5 5
☔ View full report in Codecov by Sentry. |
| btnsPosition | 裁剪区域工具栏位置,可选值为:`top` `bottom` | string | bottom | | ||
| editText | 中间的文字内容 | string | 编辑 | | ||
| cancelText | 取消按钮的文字 | string | 取消 | | ||
| cancelConfirm | 确认按钮的文字 | string | 确认 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档 API 中统一使用 kebab-case 风格
@@ -0,0 +1 @@ | |||
export type BtnsPosition = 'top' | 'bottom'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型名称需要调整为组件名开头,比如 AvatarCropperxxx
| ------------- | ------------------------------------------- | ------ | ------ | | ||
| maxZoom | 最大缩放倍数 | number | 3 | | ||
| space | 裁剪区域两边预留的间隙 | number | 10 | | ||
| btnsPosition | 裁剪区域工具栏位置,可选值为:`top` `bottom` | string | bottom | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议将 btns 整体调整为更语义化的 toolbar:
1、prop btnsPosition -> toolbar-position
2、slot bottom -> toolbar
3、类型名称 BtnsPosition -> AvatarCropperToolbarPosition
4、与之相关的 class 名称等等
@@ -0,0 +1,451 @@ | |||
<template> | |||
<view class="nut-avatar-cropper" :data-edit-text="editText"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H5 组件的 view 标签需要统一调整为 div 标签。
某些其他 H5 组件内依然有使用 view 标签,主要是有一些历史原因暂时保留。
This reverts commit 81f0843.
这个 PR 做了什么? (简要描述所做更改)
类似微信中的头像裁剪功能组件
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
这个 PR 是否已自测: